package com.example.pbj;

import java.io.Serializable;

public class Post implements Serializable {

	
	private static final long serialVersionUID = 1L;
	private int id;
    private String question;
    private String submitter;
    private String time;
    private String subject;
    private int upvotes;
    private int downvotes;
    
    public Post(int i, String q, String s,String su, String t, int u, int d) {
    	super();
    	id = i;
        question = q;
        subject = s;
        time = t;
        submitter = su;
        upvotes = u;
        downvotes = d;
    }
    
    public Post() {
    	super();
    }
    
    public int getId() {
        return id;
    }
    public void setId(int i) {
    	id = i;
    }
    
    public String getQuestion() {
        return question;
    }
    
    public void setQuestion(String q) {
        question = q;
    }
    
    public String getSubject() {
        return subject;
    }
    
    public void setSubject(String s) {
        subject = s;
    }
    public String getSubmitter() {
        return submitter;
    }
    
    public void setSubmitter(String s) {
        submitter = s;
    }
    public String getTime() {
        return time;
    }
    
    public void setTime(String s) {
        time = s;
    }
    public int getUpvotes() {
        return upvotes;
    }
    public void setUpvotes(int u) {
        upvotes = u;
    }
    public int getDownvotes() {
        return downvotes;
    }
    public void setDownvotes(int d) {
        downvotes = d;
    }
    
    public void updvote(){
    	upvotes = upvotes + 1;
    }
    
    public void downvote(){
    	downvotes = downvotes + 1;
    }
	@Override
	public String toString(){
		return subject;
	}
    
    
    
}
